#define _CRT_SECURE_NO_WARNINGS 1


#include<vector>
#include<string>
#include<algorithm>
#include<iostream>

using namespace std;

vector<string> Extract(string s)
{
	
}

int main()
{
	int n = 0;
	cin >> n;
	vector<string> v(n);
	for (int i = 0; i < n; i++)
	{
		string temp;
		cin >> temp;
		int cur = 0;
		while (temp[cur] != '(')
		{
			if (temp[cur] >= 'A' && temp[cur] <= 'Z')
			{
				temp[cur] += 32;
			}
			cur++;
		}
		v.push_back(temp);
	}
	for (int i = 0; i < n; i++)
	{
		vector<string> v_i;
		for (int j = i + 1; j < n; j++)
		{
			
		}
	}

	return 0;
}